<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=request.getContextPath()%>/" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css"
	href="css/bootstrap-theme.min.css" />
<script src="js/jquery-2.1.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<title>Insert title here</title>
</head>
<body>
		<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
    <div class="navbar-header">
        <a class="navbar-brand" href="#">${rt.reportType }页面</a>
    </div>
    <div>
        <form class="navbar-form navbar-left" role="search">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="Search">
            </div>
            <button type="submit" class="btn btn-default">搜索</button>
        </form>
        <input type="button" class="btn btn-default navbar-btn" value="添加${reportType }" onclick="showAdd()">
    </div>
	</div>
</nav>
		<table class="table table-striped table-bordered table-hover">
			<tbody>
			<tr style="font-weight: bold;">
			<td>计划</td>
			<td>已完成工作</td>
			<td>未完成工作</td>
			<td>自评(满分10)</td>
			<td>需要的支持和帮助</td>
			<td>审批状态</td>
			<td>附件</td>
			<td>备注</td>
			</tr>
					<tr>
					<td>${rt.reportPlan }</td>
					<td>${rt.offWork }</td>
					<td>${rt.waitWork }</td>
					<td>${rt.iSay }</td>
					<td>${rt.help }</td>
					<td>
					<c:if test="${rt.state==1 }">
					待审批
					</c:if>
					<c:if test="${rt.state==2 }">
					审批通过
					</c:if>
					</td>
					<td id="xxx${rt.id }"><input type="button" onclick="aaa('${rt.fileName }','${rt.spar }','${rt.id }')" value="查看">
					</td>
					<td>${rt.other }</td>
					</tr>
			</tbody>
		</table>
		<form  role="form" action="report/update" method="post">
               	请评分(满分10)<br>
               	<select name="headSay">
               		<option value="0" selected="selected">0</option>
               		<option value="1" >1</option>
               		<option value="2" >2</option>
               		<option value="3" >3</option>
               		<option value="4" >4</option>
               		<option value="5" >5</option>
               		<option value="6" >6</option>
               		<option value="7" >7</option>
               		<option value="8" >8</option>
               		<option value="9" >9</option>
               		<option value="10" >10</option>
               	</select><br>
               	<input type="hidden" name="id" value="${rt.id }">
				<input type="hidden" name="updater" value="${emp.empName }">
				<input type="hidden" name="reportType" value="${rt.reportType }">
            <button type="submit" class="btn btn-default">审批完成</button>
        </form>	
</body>
</html>
<script>
	function aaa (item1,item2,item3) {
    	var msg2="";
        var a=[];
        if (item1.charAt(item1.length-1).indexOf(",")>=0) {
            item1=item1.substring(0,item1.length-1)

        }
        if (item2.charAt(item2.length-1).indexOf(",")>=0) {
            item2=item2.substring(0,item2.length-1)
        }
        var aList1=item1.split(",");
        var aList2=item2.split(",");
        for (var i = 0; i < aList1.length; i++) {
            for (var j = 0; j < aList2.length; j++) {
                if (aList2[j].indexOf(aList1[i])>=0) {
                    var c=aList2[j].replace(aList1[i],"");
                    a.push(c)
						msg2+="<a href=img/download/"+c+">"+aList1[i]+"</a><br>";
                    break;
                }
            }
        }
        $("#xxx"+item3).html(msg2)
        
    }
</script>
